class Solution(object):
    def minFlips(self, a, b, c):
        ans = 0
        for i in range(31):
            if ((a >> i) & 1) | ((b >> i) & 1) != ((c >> i) & 1):
                if ((a >> i) & 1) & ((b >> i) & 1):
                    ans += 2
                else:
                    ans += 1
        return ans
